﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.Generic;

namespace GoToCoord.Models
{
    public class ViewMode
    {
        public static ViewMode Decimal = new ViewMode(0, "Decimal");
        public static ViewMode Hour = new ViewMode(1, "Hour, Decimal minutes");

        public static IEnumerable<ViewMode> Modes
        {
            get
            {
                yield return Decimal;
                yield return Hour;
            }
        }

        public int Id { get; private set; }
        public string Name { get; private set; }

        public ViewMode(int id, string name)
        {
            this.Id = id;
            this.Name = name;
        }

        public override bool Equals(object obj)
        {
            ViewMode vm1 = obj as ViewMode;

            if (vm1 == null)
                return false;

            return vm1.Id == this.Id;
        }

        public override int GetHashCode()
        {
            return Id;
        }
    }
}
